{extend name="public/base" /}
{block name="title"}文章管理{/block}
{block name="css"}

{/block}
{block name="main"}

<div class="wrapper wrapper-content  animated fadeInRight article">
    <div class="row">
        <div class="col-lg-10 col-lg-offset-1">
            <div class="ibox-content" style="padding:10px">
                <div class="ibox">
                    <a class="btn btn-sm btn-primary" href="{:url('article/articleStat',['id'=>$id])}">查看访问统计</a>
                    <div class="pull-right">
                        {volist name="article.categorys" id="vo"}
                        <span class="label">{$vo.title_cn}</span>
                        {/volist}
                        <button class="btn btn-white btn-xs" id="btnCopy" data-clipboard-text="{:url('cms/Article/viewArticle', ['aid'=>$article.id], true, get_config('domain_name'))}">
                            复制文章地址
                        </button>
                    </div>
                    <div class="text-center article-title">
                        <h1>
                            {$article.title}
                        </h1>
                        {if $article.status == 5}
                        <span class="text-muted"> 创建时间：{$article.create_time}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发布时间：{$article.update_time}</span>
                        {else if}
                        <span class="text-muted"> 创建时间：{$article.create_time}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发布时间：未发布</span>
                        {/if}
                        <br/>
                        {foreach name="$article->metas('tag')" item="tag"}
                        <span class="text-muted"><i class="fa fa-tags"></i>{$tag}</span>
                        {/foreach}
                    </div>
                    <article style="word-wrap:break-word; word-break: break-all;overflow:hidden">
                        {$article.content|raw}
                    </article>
                    <hr>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="small text-right">
                                <h5>Stats:{$article.status_text}</h5>
                                <i class="fa fa-eye"> </i> {$article.read_count|default=0} views
                            </div>
                        </div>
                    </div>

                    {empty name="$comments"}
                    <h2>该篇文章未有人评论</h2>
                    {else if}
                    <h2>评论：</h2>
                    {volist name='comments' id='comment'}
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="social-feed-box">
                                <div class="social-avatar">
                                    <a href="#" class="pull-left">
                                        <img alt="image" src="__PUBLIC__/static/theme/wenews/images/header_img1.png">
                                    </a>
                                    <div class="media-body">
                                        <a href="#">
                                            {$comment.author}
                                        </a>
                                        <small class="text-muted">{$comment.create_time|date="Y-m-d H:i"}
                                        </small>
                                    </div>
                                </div>
                                <div class="social-body">
                                    <p>
                                        {$comment.content}
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                    {/volist}
                    <div style="text-align: center; padding:30px 0">
                        {$comments->render()|raw}
                    </div>
                    {/empty}

                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="js"}
<script src="__PUBLIC__/static/inspinia/js/plugins/clipboard/clipboard.min.js"></script>
<script>
    var clipboard = new Clipboard('#btnCopy');
</script>
{/block}